package com.buddies.lottery.ui.home;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.buddies.lottery.R;
import com.buddies.lottery.data.bean.Banner;
import com.facebook.drawee.view.SimpleDraweeView;
import com.youth.banner.loader.ImageLoaderInterface;

public class FrescoImageLoader implements ImageLoaderInterface {

    @Override
    public void displayImage(Context context, Object path, View imageView) {
        Banner banner = (Banner) path;
        ((SimpleDraweeView) imageView).setImageURI(banner.pic_url);
    }

    @Override
    public View createImageView(Context context) {
        SimpleDraweeView imageView = (SimpleDraweeView) LayoutInflater.from(context).inflate(R.layout.item_banner, null);
        return imageView;
    }

}
